//
//  ViewController.m
//  AppShellTool
//
//  Created by IOS01 on 2022/12/2.
//

#import "ViewController.h"
#import "LuanchHeader.h"
#import "SocketClient.h"
#import "BundleTool.h"
#import "TargetViewController.h"

@interface ViewController ()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UITextField *textField;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [[SocketClient shareClient] connect];
    self.textField.delegate = self;
    
    [BundleTool saveBundleJson];
    
    self.title = @"启动";
    
//    UIButton *push = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 45)];
//    [push setTitle:@"跳转" forState:UIControlStateNormal];
//    [push addTarget:self action:@selector(pushVc:) forControlEvents:UIControlEventTouchDown];
//    push.backgroundColor = [UIColor grayColor];
//    [self.view addSubview:push];
    
}

- (void)pushVc:(UIButton *)btn{
    [self.navigationController pushViewController:[TargetViewController new] animated:YES];
}


- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
   
}
- (IBAction)sendMsg:(id)sender {
    
    NSString *str = self.textField.text;
    [[SocketClient shareClient] sendMsg:str];
}

- (IBAction)link:(id)sender {
    [[SocketClient shareClient] connect];
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [self.view endEditing:YES];
    return YES;
}

@end
